<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Download</title>
<script src="https://cdn.bootcdn.net/ajax/libs/eruda/2.3.3/eruda.js"></script> <script>eruda.init();</script>
</head>
<body> 
<script>
// 截取字符串后面的参数
function getParameter(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); // 构建一个含有目标参数的正则表达式对象
    var r = window.location.search.substr(1).match(reg); // 匹配目标参数
    if (r != null) {
      //清理参数中为null的值
      if (unescape(r[2]) == "null") { //在这里做了优化，因为为空时获取的是字符串null
        return "";
      }
      return unescape(r[2]); // unescape()解码，返回参数值
    } else {
      return "";
    }
  }

  // 获取url中的参数
  let pack = getParameter("pack")
</script>
 <h1>下载请求</h1>
  <table border="1">
  <tr>
  <td>应用名称</td>
  <td>详细信息</td>
  <td>操作</td>
  </tr>
  <tr>
  <td id="appName">null</td>
  <td id="config">null</td>
  <td><a href="" id="download">下载</a></td>
  </tr>
  </table>
  <input type="file" id="file" style="display:none"/>
  
  <script>
  var a = document.getElementById("appName");
  a.innerText = pack;
  
  var c = document.getElementById("config");
  var size = document.getElementById("file").files[0].size / 1024 + " KB";
  var lastModifiedDate = document.getElementById("file").files[0].lastModifiedDate;
  c.innerText = "{    'size': {        '" +  size + "': '字符串'    },    'appName': {        " + pack + ": '字符串'    },    'lastModifiedDate': {        " + lastModifiedDate + ": '字符串'    }}";
  
  var download = document.getElementById("download");
  download.href = "download/" + pack;
  </script>
  
  <script>
function fuckyou(){
     window.close(); //关闭当前窗口(防抽)
     window.location="about:blank"; //将当前窗口跳转置空白页
}
function ck() {
     console.profile();
     console.profileEnd();
     //我们判断一下profiles里面有没有东西，如果有，肯定有人按F12了，没错！！
     if(console.clear) { console.clear() };
     		if (typeof console.profiles =="object"){
    				return console.profiles.length > 0;
            }
	 }
function hehe(){
	 if( (window.console && (console.firebug || console.table && /firebug/i.test(console.table()) )) || (typeof opera == 'object' && typeof opera.postError == 'function' && console.profile.length > 0)){
	        fuckyou();
	 }
	 if(typeof console.profiles =="object"&&console.profiles.length > 0){
			fuckyou();
	 }
}
hehe();
window.onresize = function(){
	 if((window.outerHeight-window.innerHeight)>200)
	 		//判断当前窗口内页高度和窗口高度，如果差值大于200，那么呵呵
     		fuckyou();
}
</script>
</body>
</html>